import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import {codeInspectorPlugin} from 'code-inspector-plugin'
// https://vite.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        codeInspectorPlugin({
            bundler: 'vite'
        })
    ],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:8899',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, ''), // 移除请求路径中的 '/api' 前缀
            }
        }
    }

})
